package main

import (
	"fmt"
	"net"
	"os"
)

func main() {
	ip := "192.168.21.21:"
	addr := ip + os.Args[1]
	fmt.Println(addr)
	conn, err := net.Dial("udp", addr)
	defer conn.Close()
	if err != nil {
		os.Exit(1)
	}

	sendMsg := "yuntongxunyt[client_id:" + os.Args[2] + "]"
	//sendMsg := "yuntongxunyt[client_id:" + os.Args[2] + ",conf_id:1,member_id:1,conf_pass:,req_type:3" + "]"
	//	conn.Write([]byte("yuntongxunyt[client_id:1]"))
	//sendMsg := "hello world"
	conn.Write([]byte(sendMsg))

	fmt.Println("send msg...", sendMsg)

	//	var msg [20]byte
	//	conn.Read(msg[0:])

	//fmt.Println("msg is", string(msg[0:10]))
}
